package com.bestcem.xm.om.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * 行业对应邮箱枚举类
 *
 * @author zhangfeng <feng.zhang@idiaoyan.com>
 * @version v1.0
 * @date 2021/8/4 9:45
 */
@Getter
public enum CodeMailEnum {
    /**
     * 零售｜快消
     */
    APPLICANT_TRADE_RETAIL(CEMIndustryCodeEnum.APPLICANT_TRADE_RETAIL, MailEnum.RETAIL_MAIL_DICT),
    /**
     * 餐饮
     */
    APPLICANT_TRADE_DIET(CEMIndustryCodeEnum.APPLICANT_TRADE_DIET, MailEnum.DIET_MAIL_DICT),
    /**
     * 汽车｜交通｜物流
     */
    APPLICANT_TRADE_VEHICLE(CEMIndustryCodeEnum.APPLICANT_TRADE_VEHICLE, MailEnum.VEHICLE_MAIL_DICT),
    /**
     * 医疗
     */
    APPLICANT_TRADE_MEDICAL(CEMIndustryCodeEnum.APPLICANT_TRADE_MEDICAL, MailEnum.MEDICAL_MAIL_DICT),
    /**
     * 地产
     */
    APPLICANT_TRADE_ESTATE(CEMIndustryCodeEnum.APPLICANT_TRADE_ESTATE, MailEnum.MALL_MAIL_DICT),
    /**
     * 旅游｜文化
     */
    APPLICANT_TRADE_TOURISM(CEMIndustryCodeEnum.APPLICANT_TRADE_TOURISM, MailEnum.MALL_MAIL_DICT),
    /**
     * 酒店
     */
    APPLICANT_TRADE_HOTEL(CEMIndustryCodeEnum.APPLICANT_TRADE_HOTEL, MailEnum.MALL_MAIL_DICT),
    /**
     * 银行｜保险｜金融
     */
    APPLICANT_TRADE_FINANCE(CEMIndustryCodeEnum.APPLICANT_TRADE_FINANCE, MailEnum.FINANCE_MAIL_DICT),
    /**
     * 互联网｜软件｜SaaS
     */
    APPLICANT_TRADE_INTERNET(CEMIndustryCodeEnum.APPLICANT_TRADE_INTERNET, MailEnum.TMT_MAIL_DICT),
    /**
     * 通信
     */
    APPLICANT_TRADE_COMMUNICATIONS(CEMIndustryCodeEnum.APPLICANT_TRADE_COMMUNICATIONS, MailEnum.TMT_MAIL_DICT),
    /**
     * 高校
     */
    APPLICANT_TRADE_COLLEGES(CEMIndustryCodeEnum.APPLICANT_TRADE_COLLEGES, MailEnum.HUMAN_SERVICES_MAIL_DICT),
    /**
     * 公共事业
     */
    APPLICANT_TRADE_HUMAN_SERVICES(CEMIndustryCodeEnum.APPLICANT_TRADE_HUMAN_SERVICES, MailEnum.HUMAN_SERVICES_MAIL_DICT),
    /**
     * 调研｜咨询｜广告
     */
    APPLICANT_TRADE_HUMAN_CONSULTATION(CEMIndustryCodeEnum.APPLICANT_TRADE_HUMAN_CONSULTATION, MailEnum.RETAIL_MAIL_DICT),
    /**
     * 其他
     */
    APPLICANT_TRADE_OTHER(CEMIndustryCodeEnum.APPLICANT_TRADE_OTHER, MailEnum.OTHER_MAIL_DICT),
    /**
     * 美业
     */
    APPLICANT_TRADE_CARE_BEAUTY(CEMIndustryCodeEnum.APPLICANT_TRADE_CARE_BEAUTY, MailEnum.MEDICAL_MAIL_DICT),
    /**
     * 3C｜家电
     */
    APPLICANT_TRADE_3C(CEMIndustryCodeEnum.APPLICANT_TRADE_3C, MailEnum.APPLIANCE_MAIL_DICT),
    /**
     * 物业
     */
    APPLICANT_TRADE_PROPERTY(CEMIndustryCodeEnum.APPLICANT_TRADE_PROPERTY, MailEnum.MALL_MAIL_DICT),
    /**
     * 游戏
     */
    APPLICANT_TRADE_GAME(CEMIndustryCodeEnum.APPLICANT_TRADE_GAME, MailEnum.TMT_MAIL_DICT),
    /**
     * B2B
     */
    APPLICANT_TRADE_B2B(CEMIndustryCodeEnum.APPLICANT_TRADE_B2B, MailEnum.B2B_MAIL_DICT);

    private final CEMIndustryCodeEnum cemIndustryCodeEnum;

    private final MailEnum mailEnum;

    CodeMailEnum(CEMIndustryCodeEnum cemIndustryCodeEnum, MailEnum mailEnum) {
        this.cemIndustryCodeEnum = cemIndustryCodeEnum;
        this.mailEnum = mailEnum;
    }

    public static MailEnum getByCemIndustryCodeEnum(CEMIndustryCodeEnum cemIndustryCodeEnum) {
        if (Objects.isNull(cemIndustryCodeEnum)) {
            return null;
        }
        for (CodeMailEnum status : values()) {
            if (cemIndustryCodeEnum == status.getCemIndustryCodeEnum()) {
                return status.getMailEnum();
            }
        }
        return null;
    }

}
